UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0n0wYj80nTxuWsrV5AYsPDl+8N18BUt/LzcgC7rNroI=' 
WHERE 
  key_id = 'ef934dddc5710db658646751e42bddb7d51499b3aab0f7b46d8e615a8a420ff9' 
  AND (
    token = '0n0wYj80nTxuWsrV5AYsPDl+8N18BUt/LzcgC7rNroI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037