UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZBIZ+B8KceARTxyxbLyDQthNfYSAMrVScDUwke8Dm5w=' 
WHERE 
  key_id = 'cd4ec54cafeda5185e36454cc9092836c68d1c6e95b8e5b54195cbb03a41dcda' 
  AND (
    token = 'ZBIZ+B8KceARTxyxbLyDQthNfYSAMrVScDUwke8Dm5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023