UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VajI27pQ1uzZUTsTwe4ti0udu39NnldBF4axEKCwAPY=' 
WHERE 
  key_id = '0be309e1a86d31c7da4de4bfe67011d8c182a1aac8b40c7c2f40524d0b431f94' 
  AND (
    token = 'VajI27pQ1uzZUTsTwe4ti0udu39NnldBF4axEKCwAPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037