UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pc5jt2A/FrTfR8LNQzr7NO/COkUPHgcmjVHk+KViZ78=' 
WHERE 
  key_id = '9702ffc0013455feb44ad3ab8a8b073f4ad5b57510ce68e0b490c7330140a124' 
  AND (
    token = 'pc5jt2A/FrTfR8LNQzr7NO/COkUPHgcmjVHk+KViZ78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061