UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lt1oQt2YgbRYbS0glGm+LxFp7NSng4n9VNlbKXFB7ig=' 
WHERE 
  key_id = 'cdbdb06d6753ab305735ea8ddd7be51552ae798b76ff047ce34f2dbd8dbf7018' 
  AND (
    token = 'lt1oQt2YgbRYbS0glGm+LxFp7NSng4n9VNlbKXFB7ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037