UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'boqr/oA1YUvnD5PLsRK76fCykuTh4NdkhbMNUXbGGmQ=' 
WHERE 
  key_id = '8a12cde5fd0ef42e8e8b4fd3c53c009d7a47859a0b72c972817f75f94194f687' 
  AND (
    token = 'boqr/oA1YUvnD5PLsRK76fCykuTh4NdkhbMNUXbGGmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049