UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pNogeqAcxeNH6nb640aDl+yaA4Ftu9xTMTGiU0pIq5U=' 
WHERE 
  key_id = '71f8427b6493daf3fcf98aac5a71171490ded56d40ebfcc6e4cc17ee14f9951a' 
  AND (
    token = 'pNogeqAcxeNH6nb640aDl+yaA4Ftu9xTMTGiU0pIq5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067