UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9acsffFwWb5pSRhCnWUKSZwUC02dwacI43DqyoJ0+6U=' 
WHERE 
  key_id = '0b0a4f15604cb256ec501214f84f08ec0189b7544ecb7183f385997c8b32c26f' 
  AND (
    token = '9acsffFwWb5pSRhCnWUKSZwUC02dwacI43DqyoJ0+6U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031