UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D+yj6udCXdUW6Gq98lIG5Y3B49ZMJT6Axdu4ZJZLhc8=' 
WHERE 
  key_id = '05e0b7dfd8495c1cf45502f32e0be7f6378419d6f20b601ced8c968ffdda1409' 
  AND (
    token = 'D+yj6udCXdUW6Gq98lIG5Y3B49ZMJT6Axdu4ZJZLhc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052