UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SAEyubs6ZlQ+EbqKucELilRZQbSd+DeuTo4vdwqoFIA=' 
WHERE 
  key_id = '55ef93bfca17a4857283a8fae8b4970b88c573098c32144fff8731e223b40d53' 
  AND (
    token = 'SAEyubs6ZlQ+EbqKucELilRZQbSd+DeuTo4vdwqoFIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040