UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '02l//aVC4H6SY7DyUWxepKsZkzTgs/ItnAPazReYhXs=' 
WHERE 
  key_id = 'ed5f7ca028e62ebc824af92e184dbd71d6fe1cd162d16a910314ff17fb3c71e3' 
  AND (
    token = '02l//aVC4H6SY7DyUWxepKsZkzTgs/ItnAPazReYhXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015