UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HHgsMA1grhV9rvD30hqKAOrE7jeGvODJUSOOvOIOwAA=' 
WHERE 
  key_id = '70256197ecc919d065640d177e90acb8f6fbefc1cd6fc441c3412f1f565f3760' 
  AND (
    token = 'HHgsMA1grhV9rvD30hqKAOrE7jeGvODJUSOOvOIOwAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033