UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bBjVTw/5sVh6YhAuNxFVQZPVBpt2wsFQPvSxMdILers=' 
WHERE 
  key_id = '72a0fd7b30261aa28125e83fd0e68f9a674b4e95dcbbba222750563ead68960d' 
  AND (
    token = 'bBjVTw/5sVh6YhAuNxFVQZPVBpt2wsFQPvSxMdILers=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035